Develop PHP Website for Learning Web Design Free Online
  Home   |   Forums   |   DevCMS
  Join   |   Log In
 
   

Forum Index >> PHP and MySQL Forum

Holder
Help Member's online/server online?
   New topic    
 
Help Member's online/server online?
by allizzel777 - Fri Jul 30, 2010 03:31:28 AM

Here is the code that i have but i would like to take out the accounts made and characters created. this is for a private server i host.

CODE:Gun


<?php
require ("connect.php");

$res = mysql_query("SELECT count(*) FROM accounts;");
$val = mysql_fetch_array($res);
echo "<div style='top'><font color='white'>Accounts Created: ".$val[0]."</div>";

$res = mysql_query("SELECT count(*) FROM characters;");
$val = mysql_fetch_array($res);
echo "<div style='top'><font color='white'>Characters Created: ".$val[0]."</div>";

$ip = "69.236.143.117";
$port = "9958"; //keep this what it is!!
if (! $sock = @fsockopen($ip, $port, $num, $error, 5))
echo "<body bgcolor='black'><font color='white'>Server: </font><B><FONT COLOR=red>Offline</b></FONT>";
else{
echo "<body bgcolor='black'><font color='white'>Server: </font><B><FONT COLOR=lime>Online</b></FONT>";
fclose($sock);
}

$res = mysql_query("SELECT count(*) FROM accounts WHERE online=1;");
$val = mysql_fetch_array($res);
echo "<div style='top'><font color='white'>Total Players Online: ".$val[0]."</div>";
?>
allizzel777
Forum & Site XP Level:

United States of America
cali
Folsom

CapricornCapricorn
Posts: 1
Joined: 07/30/10
Website: URL

   New topic  
 
 
Arbitrary Links and Archives
Home
Active Forums
Members
SIte News
Link To Us
Gear
2009 Forum Archive
Programming Courses
Learn HTML
Learn CSS
Learn PHP
Learn MySQL
Learn Javascript
Learn jQuery
Learn ActionScript 3.0
Learn Java
Learn XML
DevelopPHP Requires Flash Player
Get Adobe Flash player
___________________________________________

Terms of Use  •  Privacy  •  Admin Notes

©2010 developphp.com   |   Powered By FlashBuildingHolder